<template>
    <div class="container">
        <div class="tab-radius">
            <tab-radius
                :list="['统计分析', '充值明细']"
                :active="payIndex"
                @change="onPayTab"
                divided="100%"
            />
        </div>
      <div>
            <census  :payIndex="payIndex"/>
        </div>
      <div>
            <recharge :payIndex="payIndex"/>
        </div>
    </div>
</template>

<script lang="ts" setup>
import tabRadius from '@/components/tab-radius/tab-radius.vue'
import census from '@/packageQuick/pages/electronic-sign/census/census.vue'
import recharge from '@/packageQuick/pages/electronic-sign/recharge/recharge.vue'
import { ref, nextTick } from 'vue'
import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import user from '@/utils/user'

const payIndex = ref(0)
/* 切换tab栏索引 */
// eslint-disable-next-line @typescript-eslint/no-empty-function
  const onPayTab = (index: number) => {
    console.log('Now DOM is updated')
    console.log(index, 'indexindex')
    // eslint-disable-next-line @typescript-eslint/no-empty-function
     nextTick(() => {
     })
    payIndex.value = index
  }
onLoad(async () => {
  // await user.waitLogin()
  // refundmentDetail()
  uni.$on('onReachBottom', function (data) {
    console.log('onReachBottom')
  })
})

onReachBottom(() => {
  if (payIndex.value === 1) {
    uni.$emit('onReachBottom')
    // eslint-disable-next-line no-empty
  } else {
  }
})
</script>

<style lang="scss" scoped>
.container {
    min-height: 100vh;
    background: $white;
    padding: 30rpx 0rpx 94rpx 0rpx;
    box-sizing: border-box;
}
.tab-radius {
    margin-top: 30rpx;
    padding: 0rpx 30rpx;
    box-sizing: border-box;
}
</style>
